<%@ include file="/WEB-INF/jsp/includes/include.jsp" %>


<!--	BEGIN CONTENT HOLDER -->
<div id="contentHolder">

	<c:if test="${users != null}">
		<c:forEach items="${users}" var="user">

			<c:url scope="page" value="/user/profile.html" var="userProfileURL">
				<c:param name="id" value="${user.id}"/>
			</c:url>
			<c:url scope="page" value="/user/adduser.html" var="addUserURL">
				<c:param name="id" value="${user.id}"/>
			</c:url>
			<c:url scope="page" value="/user/removeuser.html" var="removeUserURL">
				<c:param name="id" value="${user.id}"/>
			</c:url>
			<c:url scope="page" value="/messageboard/postmessage.html" var="postMessageURL">
				<c:param name="id" value="${user.id}"/>
			</c:url>
			<c:url scope="page" value="/getImage.do" var="userImg">
				<c:param name="imgsrc" value="${user.imgSrc}"/>
			</c:url>

			<!-- BEGIN USER -->
			<div class="userDetails">
		
				<div class="userImage">
					<a href="${userProfileURL}">
						<img src="${userImg}" alt="${user.name}" width="70" class="profilePhoto" />
					</a>
				</div><!-- .userImage -->
		
				<div class="userExtendedInfo">
		
					<div class="userName">
						<a href="${userProfileURL}">${user.name}</a>
					</div> <!-- .userName -->
		
					<div class="userMoreInfo">
		
						<table class="userMoreInfoTable">
							<colgroup>
								<col class="col1">
								<col class="col2">
							</colgroup>
							<tr class="row1">
								<td>
									<span class="title">#Friends:</span>
									<span class="value">${user.userNetworkSize}</span>
								</td>
								<td>
									<span class="title">#Projects:</span>
									<span class="value">${user.projectNetworkSize}</span>
								</td>
							</tr>
		
							<tr class="row2">
								<td>
									<span class="title">#Organisations:</span>
									<span class="value">${user.organisationNetworkSize}</span>
								</td>
								<td>
									<span class="title">&nbsp;</span>
									<span class="value">&nbsp;</span>
								</td>
							</tr>
		
						</table> <!-- .userMoreInfoTable -->
					</div> <!-- .userMoreInfo -->
				</div> <!-- .userExtendedInfo -->
		
				<div class="userDealClincher">
					<span class="viewUserProfile">
						<a href="${userProfileURL}">&raquo; View ${user.name}'s profile</a>
					</span>
					<span class="joinUser">
					
        				<handsunited:relationship entity="${loggedInUser}" member="${user}">
        					<handsunited:status status="Active">
		        				<a href="${removeUserURL}">
		        					&raquo; Remove ${user.name} from network
		        				</a>
        					</handsunited:status>
        					<handsunited:status status="Unknown">
		        				<a href="${addUserURL}">
		        					&raquo; Add ${user.name} to network
		        				</a>
        					</handsunited:status>
        					<handsunited:status status="AwaitingAuthorisation">
        						&raquo; Awaiting Authorisation
        					</handsunited:status>
        					<handsunited:status status="ActionPending">
        						&raquo; Authorise | &raquo; Reject
        					</handsunited:status>
        				</handsunited:relationship>
        			</span>
				</div><!-- .userDealClincher -->
		
			</div> <!-- .userDetails -->
			<!-- END FIRST PROJECT -->

		</c:forEach>
	</c:if>

</div> <!-- #contentHolder -->
<!-- END CONTENT HOLDER -->
